import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:ytbusiness/utils/screen_adaptation.dart';
//图片信息
class ImageListInfo extends StatefulWidget {
  @override
  _ImageListInfoState createState() => _ImageListInfoState();
}

class _ImageListInfoState extends State<ImageListInfo> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            margin: EdgeInsets.only(top: setWidth(20),bottom: setWidth(15)),
            child: Text("事故图片",style: TextStyle(color: Color(0xff323232),fontSize: setSp(15),fontWeight: FontWeight.w400),),
          ),
          Container(
            child: StaggeredGridView.countBuilder(
              physics: NeverScrollableScrollPhysics(),
              shrinkWrap: true,
              crossAxisCount: 3,
              mainAxisSpacing: setWidth(10),
              crossAxisSpacing: setWidth(10),
              staggeredTileBuilder: (i) {
                return StaggeredTile.fit(1);
              },
              itemCount: 6,
              itemBuilder: (context, index) {
                return GestureDetector(
                    onTap: (){
                    },
                    child: _gridItem(index));
              },
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: setWidth(20),bottom: setWidth(15)),
            child: Text("定损图片",style: TextStyle(color: Color(0xff323232),fontSize: setSp(15),fontWeight: FontWeight.w400),),
          ),
          Container(
            child: StaggeredGridView.countBuilder(
              physics: NeverScrollableScrollPhysics(),
              shrinkWrap: true,
              crossAxisCount: 3,
              mainAxisSpacing: setWidth(10),
              crossAxisSpacing: setWidth(10),
              staggeredTileBuilder: (i) {
                return StaggeredTile.fit(1);
              },
              itemCount: 6,
              itemBuilder: (context, index) {
                return GestureDetector(
                    onTap: (){
                    },
                    child: _gridItem(index));
              },
            ),
          )
        ],
      ),
    );
  }

  //图片
  Widget _gridItem(int index) {
    return Container(
      width: setWidth(109.5),
      height: setWidth(73.5),
      child: Image.network("https://i.loli.net/2020/11/30/h8zLH3cWs745aNe.png",fit:BoxFit.cover),
    );
  }
}

